//
//  UIView+Extention.swift
//  SinaBlog
//
//  Created by macs on 15/11/16.
//  Copyright © 2015年 BlackTail. All rights reserved.
//

import UIKit

extension UIView {
    
    func getNavgationController () -> UINavigationController? {
        
        //便利响应者链条,找到导航控制器
        var next = self.nextResponder()
        repeat {
        
            if next is UINavigationController {
                return next as? UINavigationController
            }
            next = next!.nextResponder()
        } while next != nil
        
        return nil
    }
    
}
